
             
/**
 * Copyright (c) 2012-2013 JLLT Corp. 2012-2013,All Rights Reserved.
 * This software is published under the 金麟龙腾商贸有限公司.
 * License version 1.0, a copy of which has been included with this
 * distribution in the LICENSE.txt file.
 *
 * @File name:  TPointsChangeDao.java 
 * @Create on:  2012-10-27 15:30:834
 * @Author   :  陈伟
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
package com.boho.ecp.integral.dao;

            
import java.sql.Connection;

import cn.boho.framework.po.CQuery;
import cn.boho.framework.po.CQueryFactoryTool;
import cn.boho.framework.po.ComboPager;
import cn.boho.framework.po.DAO;
import cn.boho.framework.po.DynaBeanMap;
import cn.boho.framework.po.Pager;
            
/**
 * 【会员积分变更信息:T_POINTS_CHANGE】的Dao操作类
 * 
 */
public class TPointsChangeDao extends DAO {
	
	/**
	* 分页查询所有【会员积分变更信息:T_POINTS_CHANGE】信息
	* @param con
	* @param pager
	* @return
	* @throws Exception
	* @date 2012-10-27
	* @author 陈伟
	*
	*/
	public static ComboPager queryTPointsChangeByPager(Connection con,Pager pager, Integer memberId)throws Exception{
		StringBuffer sql = new StringBuffer();
		sql.append("select * from T_POINTS_CHANGE where IS_VALID = 1 and POINT_CHANGE_TYPE = 1");
		sql.append(" and MEMBER_ID = ? order by CHANGE_DATE desc");
		CQuery query = CQueryFactoryTool.createFactory().createCQuery();
		query.setInt(1, memberId);
		query.setCommand(sql.toString());
		return query.getDynaBeanMapComboPager("T_POINTS_CHANGE", pager,con);
	}
	/**
	* 根据主键【会员积分变更编号:POINTS_CHANGE_ID|】获得信息
	* @param con
	* @param pointsChangeId 会员积分变更编号
	* @return
	* @throws Exception
	* @date 2012-10-27
	* @author 陈伟
	*
	*/
	public static DynaBeanMap getTPointsChangeByPk(Connection con,java.lang.Integer pointsChangeId)throws Exception{
		DynaBeanMap dynaBeanMap = null;
		StringBuffer sql = new StringBuffer();
		sql.append("select * from T_POINTS_CHANGE where  POINTS_CHANGE_ID=?");
		CQuery query = CQueryFactoryTool.createFactory().createCQuery();
		query.setCommand(sql.toString());
		query.setInt(1,pointsChangeId);
		dynaBeanMap = query.getDynaBeanMap("T_POINTS_CHANGE", con);
		return dynaBeanMap;
	}
}
